package com.shangma.util;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @className: AsyncFactory
 * @description:
 * @date:2021/12/22 15:39
 */
// 异步任务工厂
public class AsyncFactory {

    public static Runnable sendCode(String phone,String code){
        // 返回的是Runnable接口的实现类
        return new Runnable(){

            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(Thread.currentThread().getName() + "-----短信发送");
            }
        };
    }
}
